package com.itita.ww2.handler.requesthandler.worldmap.utils;

import java.util.HashMap;
import java.util.Map;

import com.itita.ww2.utils.TimeUtil;
import com.itita.ww2.utils.UUIDGenerator;

public class BattleLogUtil {

	/**
	 * xxx(玩家名) 带领 xxx(联盟) 从 xxx(联盟) 中 抢夺了 xxx(城池)
	 */
	public static final Map<String, String> log0(String uName, String aNameA, String aNameB, int blockId, int cityId) {
		Map<String, String> hash = new HashMap<>();
		hash.put("uuid", UUIDGenerator.nextBattleLogId());
		hash.put("type", String.valueOf(0));
		hash.put("uName", uName);
		hash.put("aNameA", aNameA);
		hash.put("aNameB", aNameB);
		hash.put("blockId", String.valueOf(blockId));
		hash.put("cityId", String.valueOf(cityId));
		hash.put("time", String.valueOf(TimeUtil.getUtcNowMillis()));
		return hash;
	}

	/**
	 * xxx(玩家名) 带领 xxx(联盟) 占领了 xxx(城池)
	 */
	public static final Map<String, String> log1(String uName, String aName, int blockId, int cityId) {
		Map<String, String> hash = new HashMap<>();
		hash.put("uuid", UUIDGenerator.nextBattleLogId());
		hash.put("type", String.valueOf(1));
		hash.put("uName", uName);
		hash.put("aName", aName);
		hash.put("blockId", String.valueOf(blockId));
		hash.put("cityId", String.valueOf(cityId));
		hash.put("time", String.valueOf(TimeUtil.getUtcNowMillis()));
		return hash;
	}

	/**
	 * xxx(玩家名) 占领了 xxx(据点)
	 */
	public static final Map<String, String> log2(String uName, int blockId, int cityId, int baseId) {
		Map<String, String> hash = new HashMap<>();
		hash.put("uuid", UUIDGenerator.nextBattleLogId());
		hash.put("type", String.valueOf(2));
		hash.put("uName", uName);
		hash.put("blockId", String.valueOf(blockId));
		hash.put("cityId", String.valueOf(cityId));
		hash.put("baseId", String.valueOf(baseId));
		hash.put("time", String.valueOf(TimeUtil.getUtcNowMillis()));
		return hash;
	}

	/**
	 * xxx(玩家名) 防御了 xxx(据点)
	 */
	public static final Map<String, String> log3(String uName, int blockId, int cityId, int baseId) {
		Map<String, String> hash = new HashMap<>();
		hash.put("uuid", UUIDGenerator.nextBattleLogId());
		hash.put("type", String.valueOf(3));
		hash.put("uName", uName);
		hash.put("blockId", String.valueOf(blockId));
		hash.put("cityId", String.valueOf(cityId));
		hash.put("baseId", String.valueOf(baseId));
		hash.put("time", String.valueOf(TimeUtil.getUtcNowMillis()));
		return hash;
	}

	/**
	 * xxx(玩家名) 带领 xxx(联盟) 守护了 xxx(城池)
	 */
	public static final Map<String, String> log4(String uName, String aName, int blockId, int cityId) {
		Map<String, String> hash = new HashMap<>();
		hash.put("uuid", UUIDGenerator.nextBattleLogId());
		hash.put("type", String.valueOf(4));
		hash.put("uName", uName);
		hash.put("aName", aName);
		hash.put("blockId", String.valueOf(blockId));
		hash.put("cityId", String.valueOf(cityId));
		hash.put("time", String.valueOf(TimeUtil.getUtcNowMillis()));
		return hash;
	}
}
